import java.util.Arrays;

public class Qwer {

    public static void main(String[] args) {
//		int a = 10;
//		int b = 20;
//		int temp = a;
//		a = b;
//		b = temp;
//
//		System.out.println(a);
//		System.out.println(b);


        int [] nums = {110,23,556,98845,774,520,321,41,5};
        for(int i = 0;i < nums.length -1;i++) {
            for(int j = 0 ;j < nums.length -1 - i ;j++) {
                if(nums[j] < nums[j + 1]) {
                    int temp = nums[j];
                    nums[j] = nums[j + 1];
                    nums[j + 1] = temp;
                }
            }
            System.out.println("第"+(i + 1)+"轮比较以后的顺序：" + Arrays.toString(nums));
        }

        System.out.println(Arrays.toString(nums));

    }

}
